﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace My.Common.Exception
{
    public class ErrorException : System.Exception
    {
        public Dictionary<string, string> BrokenRule { get; set; }

        public ErrorException()
        {
            BrokenRule = new Dictionary<string, string>();
        }

        public ErrorException(string key, string errorMessage)
        {
            BrokenRule = new Dictionary<string, string>();
            AddError(key, errorMessage);
        }

        public void AddError(string key, string errorMessage)
        {
            BrokenRule.Add(key, errorMessage);
        }
    }
}
